package git.bds.nyc.applet.api.convert;

import git.bds.nyc.applet.api.model.dto.FarmerAuthenticationInfoDTO;
import git.bds.nyc.role.domain.authentication.FarmerAuthentication;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

/**
 * @author 成大事
 * @since 2023/3/11 17:33
 */
@Mapper
public interface AttestationConvert {

    AttestationConvert INSTANCE = Mappers.getMapper(AttestationConvert.class);


    @Mapping(source = "farmerAuthenticationInfoDTO.realName",target = "realName")
    @Mapping(source = "farmerAuthenticationInfoDTO.gender",target = "gender")
    @Mapping(source = "farmerAuthenticationInfoDTO.idCardNum",target = "idCardNum")
    @Mapping(source = "userId",target = "userId")
    @Mapping(source = "idCardFrontPath",target = "idCardFront")
    @Mapping(source = "idCardBackPath",target = "idCardBack")
    FarmerAuthentication toFarmerAuthentication(FarmerAuthenticationInfoDTO farmerAuthenticationInfoDTO,Long userId,String idCardFrontPath,String idCardBackPath);
}
